﻿namespace Be.Timvw.Framework.Domain.Specifications
{
    public class NotSpecification<T> : ISpecification<T>
    {
        private readonly ISpecification<T> specification;

        public NotSpecification(ISpecification<T> specification)
        {
            this.specification = specification;
        }

        #region ISpecification<T> Members

        public bool IsSatisfiedBy(T item)
        {
            return !this.specification.IsSatisfiedBy(item);
        }

        #endregion
    }
}